#ifndef _3D_MATH
#define _3D_MATH

#include <math.h>

typedef struct
{
    float v[3];
} Vector;

/**
 * Returns the addition of two vectors
 */
Vector add_vectors(Vector pA, Vector pB);

/**
 * Returns the subtraction of two vectors
 */
Vector sub_vectors(Vector pA, Vector pB);

/**
 * Returns the division of a vector and a float
 */
Vector div_vector(Vector pA, float pB);

/**
 * Returns the cross product of two vectors
 */
Vector cross_product(Vector pA, Vector pB);

/**
 * Returns the length of a vector
 */
float length(Vector pA);

/**
 * Returns a vector of length 1
 */
Vector unit(Vector pA);

/**
 * Returns the normal of 3 vectors in a plane
 */
Vector normal(Vector pA, Vector pB, Vector pC);

/**
 * Returns a vector composed of pX, pY and pZ
 */
Vector vector(float pX, float pY, float pZ);

#endif
